const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    askId:{
        type: mongoose.SchemaTypes.ObjectId,
        require: true,
        ref: 'Wxsask'
    },
    commentUserId:{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Wxsuser'
    },
    commentUserName:{
        type: String,
    },
    commentContent: {
        type: String
    },
    like: [{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Wxsuser'
    }],
    publishTime: {
        type: Number
    },
    responseUserName:{
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Wxsuser'
    },
    responseContent:{
        type: String
    }
}, {timestamps: {createdAt: 'created', updatedAt: 'updated'}})

module.exports = mongoose.model('Wxscomment', schema)